package com.cxz.study.application.order.web.useCase;

import com.cxz.study.application.order.web.OrderVO;
import com.cxz.study.application.order.web.mapper.OrderWebMapperStruct;
import com.cxz.study.domain.order.Order;
import com.cxz.study.domain.order.OrderDomainService;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @className: AbstractOrderUseCase
 * @author: ocxz1
 * @date: 2025/6/15 下午1:08
 * @Version: 1.0
 * @description: ddd-struct3
 */
@RequiredArgsConstructor
@Getter
public abstract class AbstractOrderUseCase<T> {

    private final OrderWebMapperStruct orderWebMapperStruct;
    private final OrderDomainService orderDomainService;

    public final OrderVO execute(T command) {
        Order order = doExecute(command);
        return orderWebMapperStruct.toVO(order);
    }

    public abstract Order doExecute(T command);
}
